package com.ndood.spider.hqgz.web;

import com.ndood.core.render.SeleniumDownloader;
import com.ndood.core.render.impl.ChromeDriverPool;
import com.ndood.spider.hqgz.action.HqgzAction;
import com.ndood.spider.hqgz.processor.HqgzPageProcessor;

import us.codecraft.webmagic.Spider;

/**
 * 爬虫控制器
 */
public class HqgzSpiderController {

	public static void main(String[] args) {
		String url = "https://item.taobao.com/item.htm?spm=a230r.7195193.1997079397.61.5EBWxv&id=554808514728&abbucket=3";
		Spider spider = Spider.create(new HqgzPageProcessor());
		spider.addUrl(url);
		spider.setDownloader(new SeleniumDownloader(5000, new ChromeDriverPool(), new HqgzAction()));
		spider.thread(1);
		spider.setExitWhenComplete(true);
		spider.start();
	}
}
